var _class, _temp;

import Taro from '@tarojs/taro-rn';
import * as tslib_1 from "tslib";
import React from 'react';
import { Component } from "@tarojs/taro-rn";
import { View, Text } from "@tarojs/components-rn";
import { getRuntime, subtime, servicePhoneNumber } from "../../utils/common";
import { toJS } from "mobx";
import PageFooterInfo from "../../components/PageFooterInfo";
import Report from "../../components/Report";
import page4_detailStyleSheet from "./page4_detail_styles";

import { inject, observer } from "@tarojs/mobx-rn";
var _styleSheet = page4_detailStyleSheet;
let LawyerDetail = (_temp = _class = class LawyerDetail extends Component {
  constructor(props) {
    super(props);
    this.state = {
      info: {},
      isVip: false
    };
  }
  componentWillMount() {
    Taro.setNavigationBarTitle({ title: '项目详情' });
    const id = this.$router.params.id;
    this.getProjectInfo(parseInt(id));
    let userInfo = getRuntime().getUserInfo() || {};
    if (userInfo.agencyLevel > 0) {
      this.setState({ isVip: true });
    }
  }
  getProjectInfo(id) {
    let { FinancialCenterStore } = this.props.stores;
    FinancialCenterStore.getProjectInfo({
      id,
      callback: res => {
        console.error(res);
        this.setState({
          info: toJS(res)
        });
      }
    });
  }
  render() {
    let { info, isVip } = this.state;
    return <View style={[_styleSheet["lawyer-wrap"], _styleSheet["lawyer-detail"]]}>
        <View style={_styleSheet["list-03"]}>
          <View style={_styleSheet["list-03-item"]}>
            <View style={_styleSheet["r"]}>
              <View style={_styleSheet["title"]}>{info.projectName}</View>
              <View style={_styleSheet["info"]}>
                <Text style={_styleSheet["date"]}>{subtime(info.creationTime)}</Text>
                <Text style={_styleSheet["date"]}>浏览{info.viewAmount}人</Text>
              </View>
            </View>
          </View>
        </View>
        <View style={_styleSheet["interval"]} />

        <View style={[_styleSheet["column-title"], _styleSheet["content-30"]]}>
          <Text style={_styleSheet["column-name"]}>项目信息</Text>
        </View>
        <View style={_styleSheet["item-lawyer"]}>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>项目类型：</Text>
            <Text style={_styleSheet["name"]}>{info.projectType}</Text>
          </View>
        
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>所在地区：</Text>
            <Text style={_styleSheet["name"]}>{info.area}</Text>
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>项目价格：</Text>
            <Text style={_styleSheet["name"]}>{info.projectPrice}</Text>
          </View>
        </View>
        <View style={_styleSheet["interval"]} />

        <View style={[_styleSheet["column-title"], _styleSheet["content-30"]]}>
          <Text style={_styleSheet["column-name"]}>企业信息</Text>
        </View>
        <View style={_styleSheet["item-lawyer"]}>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>企业名称：</Text>
            {isVip && <Text style={_styleSheet["name"]}>{info.companyName}</Text>}
            {!isVip && <View style={_styleSheet["name"]}>
                <Text>*******</Text>
                <Text style={_styleSheet["vip"]}>(VIP会员可见)</Text>
            </View>}
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>企业性质：</Text>
            <Text style={_styleSheet["name"]}>{info.natureOfTheFirm}</Text>
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>企业规模：</Text>
            <View style={_styleSheet["name"]}>
              <Text>{info.enterpriseScale}</Text>
            </View>
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>企业资质：</Text>
            <Text style={_styleSheet["name"]}>{info.enterpriseQualification}</Text>
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>纳税类型：</Text>
            <Text style={_styleSheet["name"]}>{info.taxTypes}</Text>
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>公司地址：</Text>
            {isVip && <Text style={_styleSheet["name"]}>{info.enterpriseAddress}</Text>}
            {!isVip && <View style={_styleSheet["name"]}>
                <Text>*******</Text>
                <Text style={_styleSheet["vip"]}>(VIP会员可见)</Text>
            </View>}
          </View>
        </View>
        <View style={_styleSheet["interval"]} />

        <View style={[_styleSheet["column-title"], _styleSheet["content-30"]]}>
          <Text style={_styleSheet["column-name"]}>备注</Text>
        </View>
        <View style={_styleSheet["item-lawyer-desc"]}>
          {info.remarks}
        </View>
        <View style={_styleSheet["interval"]} />

        <View style={[_styleSheet["column-title"], _styleSheet["content-30"]]}>
          <Text style={_styleSheet["column-name"]}>联系方式</Text>
        </View>
        <View style={_styleSheet["item-lawyer"]}>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>联系人：</Text>
            {isVip && <Text style={_styleSheet["name"]}>{info.contactsName}</Text>}
            {!isVip && <View style={_styleSheet["name"]}>
               <Text>*******</Text>
               <Text style={_styleSheet["vip"]}>(VIP会员可见)</Text>
            </View>}
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>联系电话：</Text>
            {isVip && <Text style={_styleSheet["name"]}>{info.phoneNumnber}</Text>}
            {!isVip && <View style={_styleSheet["name"]}>
               <Text>*******</Text>
               <Text style={_styleSheet["vip"]}>(VIP会员可见)</Text>
            </View>}
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>微信号：</Text>
            {isVip && <Text style={_styleSheet["name"]}>{info.wechatNumber}</Text>}
            {!isVip && <View style={_styleSheet["name"]}>
               <Text>*******</Text>
               <Text style={_styleSheet["vip"]}>(VIP会员可见)</Text>
            </View>}
          </View>
          <View style={_styleSheet["line"]}>
            <Text style={_styleSheet["title"]}>QQ号：</Text>
            {isVip && <Text style={_styleSheet["name"]}>{info.qqNumber}</Text>}
            {!isVip && <View style={_styleSheet["name"]}>
               <Text>*******</Text>
               <Text style={_styleSheet["vip"]}>(VIP会员可见)</Text>
            </View>}
          </View>
        </View>
        <View style={_styleSheet["interval"]} />
        <Report />

        <PageFooterInfo info={'投诉举报热线：' + servicePhoneNumber} />

      </View>;
  }
}, _class.config = {
  navigationBarTitleText: '项目详情'
}, _temp);
LawyerDetail = tslib_1.__decorate([inject("stores"), observer], LawyerDetail);
export default LawyerDetail;